package com.jd.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.jd.entity.User;
import com.jd.mapper.UserMapper;
import com.jd.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 平台用户 服务实现类
 * </p>
 *
 * @author wangshuping
 * @since 2021-11-21
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Override
    public boolean accountExist(String username) {
        return baseMapper.selectCount(new LambdaUpdateWrapper<User>().eq(User::getUsername, username)) > 0;
    }
}
